from django.db import models

# Create your models here.
from django.db import models

# Create your models here.


class Assets(models.Model):                           #资产表
    name = models.CharField(max_length=32)   #名称
    des = models.CharField(max_length=32)  #物资描述
    ass_id = models.CharField(max_length=32)  #物资编号
    times = models.DateTimeField(auto_now_add=True)    #购买时间
    people = models.ForeignKey('User',on_delete=models.CASCADE)     #购买人
    assets_class = models.ManyToManyField('Classes')




class Classes(models.Model):                       #实验室
    name = models.CharField(max_length=32)                #名称
    storey = models.CharField(max_length=32)            #楼层
    room = models.IntegerField()                       #房间号
    person = models.ForeignKey('User',on_delete=models.CASCADE)



class User(models.Model):                                #用户
    username = models.CharField(max_length=32)           #用户名
    password = models.CharField(max_length=32)          #密码
    name = models.CharField(max_length=32)              #姓名
    number = models.CharField(max_length=32)          #手机号码
    # user_class = models.ForeignKey('Classes',on_delete=models.CASCADE)

